package leetcode_interview;

import java.util.Arrays;

public class I0101 {

    public static void main(String[] args) {
        I0101 i0101=new I0101();
        i0101.isUnique("abc");
    }

    public boolean isUnique(String astr) {
        int[] dict = new int[26];
        int n = astr.length();
        for (int i = 0; i < n; i++) {
            int index = astr.charAt(i) - 'a';
            if (dict[index] == 1)
                return false;
            dict[index] = 1;
        }
        return true;
    }
}
